<template>
  <el-card class="box-card" style="width: 50%">
    <template #header>
      Register
    </template>
    <el-form :model="form" label-width="120px">
      <el-form-item label="Name">
        <el-input v-model="form.name" />
      </el-form-item>
      <el-form-item label="Phone">
        <el-input v-model="form.phone" />
      </el-form-item>
      <el-form-item label="Password">
        <el-input v-model="form.password" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">Login</el-button>
        <el-button>Cancel</el-button>
      </el-form-item>
    </el-form>
  </el-card>
</template>

<script type="ts" setup>
import {reactive} from 'vue';
import {save} from '/src/views/module/user/user.ts'
import {login} from "./login.ts";

const form = reactive({
  name: '',
  avatar: '',
  password: '',
  phone: ''
})

const onSubmit = () => {
  save(form).then(response => {
    console.log(response);
    ElNotification({
      title:'操作成功'
    })
  })
}
</script>
